import { createReadStream, createWriteStream } from 'node:fs'
import path from 'node:path'
import { fileURLToPath } from 'url'
import { globSync } from 'glob'
const 本文件路径 = fileURLToPath(import.meta.url)
const { name, ext } = path.parse(本文件路径.replace('打包', '海问 '))
const 打包文件路径 = path.join(String.raw`C:\Users\Administrator\Desktop`, `${name}.user${ext}`)
const 写入流 = createWriteStream(打包文件路径)
const 油猴脚本源目录 = './问卷油猴脚本'
globSync(`${油猴脚本源目录}/**/*.js`).sort().forEach(文件名 => createReadStream(文件名).pipe(写入流))